/* =================================================================
   TEMPLATE DETAILS (kh-tdt-*) — premium, brand-aligned detail page
   Aligned with kh-home.css / kh-footer.css / Site_Header dark-purple
   gradient theme and the per-product accent color system.
   ================================================================= */

.kh-tdt {
    --kh-deep:      #1e1b4b;
    --kh-mid:       #4c1d95;
    --kh-soft:      #5b21b6;
    --kh-purple:    #6a49f2;
    --kh-purple-2:  #8b5cf6;
    --kh-gold-a:    #fbbf24;
    --kh-gold-b:    #f59e0b;
    --kh-ink:       #1f2937;
    --kh-mute:      #6b7280;
    --kh-dim:       #9ca3af;
    --kh-line:      #ececf7;
    --kh-bg-soft:   #fafafe;
    --kh-bg-2:      #f5f3ff;
    --kh-success:   #10b981;

    /* per-product accent (overridden below per data-product) */
    --kh-acc:       #6a49f2;
    --kh-acc-2:     #4c1d95;
    --kh-acc-soft:  #ede9fe;

    background: var(--kh-bg-soft);
    color: var(--kh-ink);
}
.kh-tdt[data-product="1"] { --kh-acc: #6a49f2; --kh-acc-2: #4c1d95; --kh-acc-soft: #ede9fe; }
.kh-tdt[data-product="2"] { --kh-acc: #0ea5e9; --kh-acc-2: #1e40af; --kh-acc-soft: #e0f2fe; }
.kh-tdt[data-product="3"] { --kh-acc: #10b981; --kh-acc-2: #065f46; --kh-acc-soft: #d1fae5; }
.kh-tdt[data-product="4"] { --kh-acc: #f59e0b; --kh-acc-2: #b45309; --kh-acc-soft: #fef3c7; }
.kh-tdt[data-product="5"] { --kh-acc: #ec4899; --kh-acc-2: #9d174d; --kh-acc-soft: #fce7f3; }

/* ───────────────────────────── HERO ───────────────────────────── */
.kh-tdt-hero {
    position: relative;
    background: linear-gradient(135deg, var(--kh-deep) 0%, var(--kh-mid) 60%, var(--kh-soft) 100%);
    color: #fff;
    padding: 38px 0 80px;
    overflow: hidden;
}
.kh-tdt-hero::before,
.kh-tdt-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    opacity: 0.35;
}
.kh-tdt-hero::before {
    top: -120px; right: -80px;
    width: 360px; height: 360px;
    background: radial-gradient(circle, var(--kh-gold-a) 0%, transparent 70%);
}
.kh-tdt-hero::after {
    bottom: -140px; left: -100px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, var(--kh-acc) 0%, transparent 70%);
    opacity: 0.5;
}

.kh-tdt-hero > .container { position: relative; z-index: 1; }

/* Pill-style breadcrumb — the sticky site header uses the same dark-purple
   gradient as this hero, so a bare crumb row visually merges into the header
   band. A self-contained translucent pill stays distinct from the header on
   every page width. */
.kh-tdt-crumbs {
    /* See kh-wizard.css — `margin-top: 50px` clears the sticky site header. */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 50px;
    margin-bottom: 22px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.14);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.kh-tdt-crumbs a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}
.kh-tdt-crumbs a:hover { color: var(--kh-gold-a); }
.kh-tdt-crumbs i { font-size: 0.75rem; color: rgba(255,255,255,0.8); }
.kh-tdt-crumbs .current { color: var(--kh-gold-a); font-weight: 800; }

/* Title + meta row */
.kh-tdt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.kh-tdt-head-l { flex: 1 1 460px; min-width: 0; }
.kh-tdt-head-r {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.kh-tdt-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.kh-tdt-pill .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--kh-acc);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.10);
}
.kh-tdt-h1 {
    margin: 0 0 12px;
    font-size: 2.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
}
.kh-tdt-sub {
    margin: 0;
    color: rgba(255,255,255,0.78);
    font-size: 0.98rem;
    line-height: 1.85;
    max-width: 64ch;
}

/* Quick badges */
.kh-tdt-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.kh-tdt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
}
.kh-tdt-badge i { color: var(--kh-gold-a); font-size: 0.85rem; }
.kh-tdt-badge.free {
    background: linear-gradient(135deg, var(--kh-gold-a), var(--kh-gold-b));
    color: var(--kh-deep);
    border-color: transparent;
}
.kh-tdt-badge.free i { color: var(--kh-deep); }
.kh-tdt-badge.rating { color: var(--kh-gold-a); }

/* ───────────────────────── MAIN GRID ───────────────────────── */
.kh-tdt-body {
    position: relative;
    z-index: 2;
    margin-top: -50px;
    padding-bottom: 60px;
}

.kh-tdt-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    align-items: start;
}

/* ── Preview panel ── */
.kh-tdt-prev {
    background: #fff;
    border-radius: 22px;
    border: 1px solid var(--kh-line);
    box-shadow: 0 24px 60px rgba(30,27,75,0.08);
    overflow: hidden;
}
.kh-tdt-prev-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--kh-line);
    background: linear-gradient(180deg, #fff, #fafaff);
    gap: 12px;
    flex-wrap: wrap;
}
.kh-tdt-tabs {
    display: inline-flex;
    background: var(--kh-bg-2);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}
.kh-tdt-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--kh-mute);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.kh-tdt-tab:hover { color: var(--kh-acc); }
.kh-tdt-tab.active {
    background: linear-gradient(135deg, var(--kh-acc), var(--kh-acc-2));
    color: #fff;
    box-shadow: 0 4px 12px rgba(106,73,242,0.20);
}
.kh-tdt-tab i { font-size: 0.95rem; }

.kh-tdt-prev-tools {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}
.kh-tdt-tool {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 1px solid var(--kh-line);
    background: #fff;
    color: var(--kh-mute);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}
.kh-tdt-tool:hover {
    border-color: var(--kh-acc);
    color: var(--kh-acc);
    background: var(--kh-acc-soft);
}
.kh-tdt-tool.toast-on {
    background: var(--kh-success);
    color: #fff;
    border-color: var(--kh-success);
}

/* URL bar (visible in laptop mode) */
.kh-tdt-url {
    padding: 8px 14px;
    background: var(--kh-bg-2);
    border-radius: 999px;
    color: var(--kh-mute);
    font-family: monospace;
    font-size: 0.78rem;
    direction: ltr;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--kh-line);
}
.kh-tdt-url i { color: var(--kh-success); font-size: 0.75rem; }

/* Preview canvas */
.kh-tdt-stage {
    position: relative;
    background:
        repeating-linear-gradient(45deg, #f8f7fd 0 12px, #fafafe 12px 24px);
    padding: 40px 24px;
    min-height: 640px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Device frames */
.kh-tdt-phone {
    width: 340px;
    background: linear-gradient(145deg, #1e1e30, #0f0f1f);
    border-radius: 44px;
    padding: 14px;
    box-shadow:
        0 30px 60px rgba(30,27,75,0.20),
        0 0 0 1px rgba(255,255,255,0.05) inset;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.kh-tdt-phone-notch {
    width: 110px;
    height: 24px;
    background: #0f0f1f;
    border-radius: 0 0 18px 18px;
    margin: 0 auto 8px;
    position: relative;
}
.kh-tdt-phone-notch::after {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    margin: 10px auto 0;
}
.kh-tdt-phone-cam {
    position: absolute;
    top: 7px; left: 50%;
    transform: translateX(28px);
    width: 8px; height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #2a2a4a, #1a1a2e);
}
.kh-tdt-phone-screen {
    position: relative;            /* anchors the absolutely-positioned iframe inside */
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    height: 640px;
    transition: all 0.4s ease;
}
.kh-tdt-phone-bar {
    width: 110px; height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    margin: 10px auto 4px;
}
.kh-tdt-iframe {
    /* Stronger zoom-out (0.7) so more of the page fits and template details read better,
       especially in the narrower phone frame. Width/height bumped to 1/0.7 (≈142.86%)
       so the scaled iframe still fills the frame exactly.

       IMPORTANT — RTL fix: the parent is in dir="rtl", and an oversized block child
       extends past the LEFT edge in RTL flow. With transform-origin: top left this
       caused the iframe to anchor outside the container and leave a gap on the right.
       Absolutely positioning at top:0, left:0 takes the iframe out of RTL flow so
       transform-origin: top left aligns to the container's physical top-left as intended. */
    position: absolute;
    top: 0;
    left: 0;
    width: 142.86%;
    height: 142.86%;
    border: none;
    display: block;
    background: #fff;
    transform: scale(0.7);
    transform-origin: top left;
}
.kh-tdt-phone::before,
.kh-tdt-phone::after {
    content: '';
    position: absolute;
    right: -3px;
    width: 3px;
    background: linear-gradient(180deg, #2a2a44, #1e1e30);
    border-radius: 0 3px 3px 0;
}
.kh-tdt-phone::before { top: 120px; height: 28px; }
.kh-tdt-phone::after  { top: 170px; height: 50px; }

/* Tablet mode */
.kh-tdt-phone.is-tablet {
    width: 620px;
    border-radius: 32px;
    padding: 14px;
}
.kh-tdt-phone.is-tablet .kh-tdt-phone-notch,
.kh-tdt-phone.is-tablet::before,
.kh-tdt-phone.is-tablet::after { display: none; }
.kh-tdt-phone.is-tablet .kh-tdt-phone-screen {
    height: 740px;
    border-radius: 22px;
}

/* Laptop frame */
.kh-tdt-laptop {
    width: 100%;
    max-width: 1100px;
    transition: all 0.4s ease;
}
.kh-tdt-laptop-lid {
    background: linear-gradient(145deg, #2a2a3e, #1e1e30);
    border-radius: 16px 16px 0 0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.kh-tdt-dot { width: 11px; height: 11px; border-radius: 50%; }
.kh-tdt-dot-r { background: #ff5f57; }
.kh-tdt-dot-y { background: #febc2e; }
.kh-tdt-dot-g { background: #28c840; }
.kh-tdt-laptop-url {
    flex-grow: 1;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    font-family: monospace;
    direction: ltr;
    text-align: center;
    margin: 0 40px;
}
.kh-tdt-laptop-screen {
    position: relative;            /* anchors the absolutely-positioned iframe inside */
    background: #fff;
    border: 2px solid #2a2a3e;
    border-top: none;
    overflow: hidden;
    height: 640px;
}
.kh-tdt-laptop-base {
    width: 108%;
    margin-left: -4%;
    height: 18px;
    background: linear-gradient(180deg, #3a3a50, #2a2a3e);
    border-radius: 0 0 12px 12px;
    position: relative;
}
.kh-tdt-laptop-base::after {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 160px; height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 0 0 4px 4px;
}

/* ── Sticky sidebar ── */
.kh-tdt-side {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kh-tdt-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--kh-line);
    box-shadow: 0 12px 30px rgba(30,27,75,0.06);
    padding: 22px;
}

/* Price card */
.kh-tdt-price-card {
    border-top: 3px solid var(--kh-acc);
}
.kh-tdt-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.kh-tdt-price-val {
    font-size: 2rem;
    font-weight: 900;
    color: var(--kh-acc);
    line-height: 1;
}
.kh-tdt-price-val.is-free { color: var(--kh-success); }
.kh-tdt-price-unit {
    font-size: 0.85rem;
    color: var(--kh-mute);
}
.kh-tdt-price-old {
    font-size: 0.88rem;
    color: var(--kh-dim);
    text-decoration: line-through;
}
.kh-tdt-price-disc {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
}
.kh-tdt-price-note {
    font-size: 0.82rem;
    color: var(--kh-mute);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kh-tdt-price-note i { color: var(--kh-success); }

/* CTAs */
.kh-tdt-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}
.kh-tdt-cta-primary {
    background: linear-gradient(135deg, var(--kh-acc), var(--kh-acc-2));
    color: #fff;
    box-shadow: 0 10px 24px rgba(106,73,242,0.28);
}
.kh-tdt-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(106,73,242,0.40);
    color: #fff;
    text-decoration: none;
    filter: brightness(1.05);
}
.kh-tdt-cta-gold {
    background: linear-gradient(135deg, var(--kh-gold-a), var(--kh-gold-b));
    color: var(--kh-deep);
    box-shadow: 0 10px 24px rgba(251,191,36,0.30);
}
.kh-tdt-cta-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(251,191,36,0.45);
    color: var(--kh-deep);
    text-decoration: none;
    filter: brightness(1.05);
}
.kh-tdt-cta-ghost {
    background: var(--kh-acc-soft);
    color: var(--kh-acc-2);
    border: 1px solid transparent;
}
.kh-tdt-cta-ghost:hover {
    background: #fff;
    border-color: var(--kh-acc);
    color: var(--kh-acc-2);
    text-decoration: none;
}
.kh-tdt-cta + .kh-tdt-cta { margin-top: 10px; }

/* Trust list */
.kh-tdt-trust {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--kh-line);
    padding-top: 16px;
}
.kh-tdt-trust li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--kh-ink);
}
.kh-tdt-trust li i {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--kh-acc-soft);
    color: var(--kh-acc-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Info card */
.kh-tdt-info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.kh-tdt-info-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--kh-deep);
    margin: 0;
}
.kh-tdt-info-prod {
    font-size: 0.78rem;
    color: var(--kh-mute);
    margin-top: 2px;
}
.kh-tdt-fav {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--kh-line);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
    font-size: 1.1rem;
    color: var(--kh-dim);
    flex-shrink: 0;
}
.kh-tdt-fav:hover { border-color: #ef4444; color: #ef4444; }
.kh-tdt-fav.is-on { border-color: #ef4444; color: #ef4444; background: #fff5f5; }

.kh-tdt-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--kh-mute);
}
.kh-tdt-stars { color: var(--kh-gold-a); display: inline-flex; gap: 1px; font-size: 0.95rem; }
.kh-tdt-stars i.off { color: var(--kh-line); }

.kh-tdt-desc {
    margin: 0;
    color: var(--kh-mute);
    font-size: 0.9rem;
    line-height: 1.95;
}

.kh-tdt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.kh-tdt-chip {
    background: var(--kh-bg-2);
    color: var(--kh-acc-2);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.kh-tdt-chip.cat {
    background: #ecfdf5;
    color: #065f46;
}

/* Quick stats grid (sidebar) */
.kh-tdt-quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.kh-tdt-quick-item {
    background: var(--kh-bg-soft);
    border: 1px solid var(--kh-line);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}
.kh-tdt-quick-item .v {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--kh-deep);
    display: block;
}
.kh-tdt-quick-item .l {
    font-size: 0.74rem;
    color: var(--kh-mute);
    margin-top: 2px;
    display: block;
}
.kh-tdt-quick-item i {
    color: var(--kh-acc);
    font-size: 1rem;
    margin-bottom: 4px;
    display: block;
}

/* Share row */
.kh-tdt-share {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.kh-tdt-share-label { font-size: 0.82rem; color: var(--kh-mute); }
.kh-tdt-share a,
.kh-tdt-share button {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--kh-line);
    background: #fff;
    color: var(--kh-mute);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
    font-size: 0.9rem;
}
.kh-tdt-share a:hover,
.kh-tdt-share button:hover {
    border-color: var(--kh-acc);
    color: var(--kh-acc);
    background: var(--kh-acc-soft);
}

/* ─────────────────────── SECTIONS (FEATURES / SPEC / FAQ) ─────────────────────── */
.kh-tdt-block {
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--kh-line);
    box-shadow: 0 8px 24px rgba(30,27,75,0.04);
    padding: 28px 28px;
    margin-top: 22px;
}

.kh-tdt-block-h {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--kh-deep);
}
.kh-tdt-block-h i {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--kh-acc-soft);
    color: var(--kh-acc-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Features grid */
.kh-tdt-feats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.kh-tdt-feat {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--kh-bg-soft);
    border: 1px solid var(--kh-line);
    border-radius: 14px;
    transition: all 0.2s ease;
}
.kh-tdt-feat:hover {
    border-color: var(--kh-acc);
    background: #fff;
    box-shadow: 0 8px 20px rgba(106,73,242,0.08);
    transform: translateY(-2px);
}
.kh-tdt-feat i {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--kh-acc), var(--kh-acc-2));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.kh-tdt-feat h6 {
    margin: 0 0 4px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--kh-deep);
}
.kh-tdt-feat p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--kh-mute);
    line-height: 1.7;
}

/* Spec table */
.kh-tdt-spec {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.kh-tdt-spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--kh-bg-soft);
    border-radius: 10px;
    border: 1px solid var(--kh-line);
    font-size: 0.88rem;
}
.kh-tdt-spec-row .k {
    color: var(--kh-mute);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.kh-tdt-spec-row .k i { color: var(--kh-acc); }
.kh-tdt-spec-row .v {
    color: var(--kh-deep);
    font-weight: 700;
}

/* FAQ accordion — built on <details>/<summary>; use [open] attribute */
.kh-tdt-faq { display: flex; flex-direction: column; gap: 10px; }
.kh-tdt-q {
    background: var(--kh-bg-soft);
    border: 1px solid var(--kh-line);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.kh-tdt-q[open] {
    border-color: var(--kh-acc);
    background: #fff;
    box-shadow: 0 8px 20px rgba(106,73,242,0.08);
}
.kh-tdt-q-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 700;
    color: var(--kh-deep);
    font-size: 0.92rem;
    gap: 12px;
    list-style: none;
    user-select: none;
}
.kh-tdt-q-h::-webkit-details-marker,
.kh-tdt-q-h::marker { display: none; content: ''; }
.kh-tdt-q-h .ico {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--kh-acc-soft);
    color: var(--kh-acc-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.kh-tdt-q[open] .kh-tdt-q-h .ico { transform: rotate(180deg); }
.kh-tdt-q-b {
    padding: 0 18px 16px;
    color: var(--kh-mute);
    font-size: 0.88rem;
    line-height: 1.95;
    animation: khTdtQOpen 0.25s ease;
}
@keyframes khTdtQOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────── SIMILAR TEMPLATES ─────────────────────── */
.kh-tdt-similar { margin-top: 22px; }
.kh-tdt-sim-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.kh-tdt-sim-head .t {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--kh-deep);
    display: flex;
    align-items: center;
    gap: 10px;
}
.kh-tdt-sim-head .t i {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--kh-acc-soft);
    color: var(--kh-acc-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.kh-tdt-sim-nav { display: inline-flex; gap: 6px; }
.kh-tdt-sim-nav button {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--kh-line);
    color: var(--kh-mute);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.kh-tdt-sim-nav button:hover {
    border-color: var(--kh-acc);
    color: var(--kh-acc);
    background: var(--kh-acc-soft);
}

.kh-tdt-sim-wrap { position: relative; }
.kh-tdt-sim-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 4px 18px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}
.kh-tdt-sim-track::-webkit-scrollbar { display: none; }

.kh-tdt-sim {
    min-width: 240px;
    max-width: 240px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--kh-line);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    scroll-snap-align: start;
}
.kh-tdt-sim:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(30,27,75,0.10);
    border-color: rgba(106,73,242,0.18);
}
.kh-tdt-sim a { text-decoration: none; color: inherit; }
.kh-tdt-sim-img {
    height: 160px;
    background: linear-gradient(135deg, #f4f2ff, #eae6ff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.kh-tdt-sim-img img {
    max-height: 92%;
    max-width: 95%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.kh-tdt-sim:hover .kh-tdt-sim-img img { transform: scale(1.05); }
.kh-tdt-sim-tag {
    position: absolute;
    top: 8px; right: 8px;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fff;
}
.kh-tdt-sim-tag.free { background: var(--kh-success); }
.kh-tdt-sim-tag.disc { background: linear-gradient(135deg, #ef4444, #dc2626); }
.kh-tdt-sim-body {
    padding: 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.kh-tdt-sim-body h6 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--kh-deep);
    margin: 0 0 4px;
}
.kh-tdt-sim-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--kh-acc);
    margin-bottom: 10px;
}
.kh-tdt-sim-acts { display: flex; gap: 6px; margin-top: auto; }
.kh-tdt-sim-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: 0.2s;
}
.kh-tdt-sim-btn.view {
    background: var(--kh-bg-2);
    color: var(--kh-mute);
    border: 1px solid var(--kh-line);
}
.kh-tdt-sim-btn.view:hover {
    border-color: var(--kh-acc);
    color: var(--kh-acc);
    text-decoration: none;
}
.kh-tdt-sim-btn.go {
    background: var(--kh-acc);
    color: #fff;
    border: none;
}
.kh-tdt-sim-btn.go:hover {
    background: var(--kh-acc-2);
    color: #fff;
    text-decoration: none;
}

/* ─────────────────────── FULLSCREEN MODAL ─────────────────────── */
.kh-tdt-fs {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100000;
    background: var(--kh-deep);
    display: none;
    flex-direction: column;
}
.kh-tdt-fs.active { display: flex; }
.kh-tdt-fs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    background: linear-gradient(135deg, rgba(30,27,75,0.96), rgba(76,29,149,0.96));
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.kh-tdt-fs-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
}
.kh-tdt-fs-title i { color: var(--kh-gold-a); }
.kh-tdt-fs-actions {
    display: inline-flex;
    gap: 8px;
}
.kh-tdt-fs-actions a,
.kh-tdt-fs-actions button {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: 0.2s ease;
}
.kh-tdt-fs-actions a:hover,
.kh-tdt-fs-actions button:hover {
    background: linear-gradient(135deg, var(--kh-gold-a), var(--kh-gold-b));
    color: var(--kh-deep);
    border-color: transparent;
    text-decoration: none;
}
.kh-tdt-fs-close {
    width: 38px !important;
    padding: 0 !important;
    justify-content: center;
}
.kh-tdt-fs-frame {
    flex-grow: 1;
    overflow: hidden;
    background: #fff;
}
.kh-tdt-fs-frame iframe {
    width: 100%; height: 100%;
    border: none;
    display: block;
}

/* ─────────────────────── MOBILE STICKY CTA BAR ─────────────────────── */
.kh-tdt-mbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 90;
    background: #fff;
    border-top: 1px solid var(--kh-line);
    box-shadow: 0 -10px 30px rgba(30,27,75,0.10);
    padding: 10px 14px;
    display: none;
    align-items: center;
    gap: 10px;
}
.kh-tdt-mbar .p {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.kh-tdt-mbar .p .v {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--kh-acc);
}
.kh-tdt-mbar .p .v.is-free { color: var(--kh-success); }
.kh-tdt-mbar .p .l {
    font-size: 0.72rem;
    color: var(--kh-mute);
}
.kh-tdt-mbar a {
    background: linear-gradient(135deg, var(--kh-acc), var(--kh-acc-2));
    color: #fff;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 12px 22px;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 18px rgba(106,73,242,0.25);
}
.kh-tdt-mbar a:hover { color: #fff; text-decoration: none; filter: brightness(1.05); }

/* Toast */
.kh-tdt-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--kh-deep);
    color: #fff;
    padding: 12px 22px;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(30,27,75,0.30);
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 100001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.kh-tdt-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.kh-tdt-toast i { color: var(--kh-gold-a); }

/* ─────────────────────── RESPONSIVE ─────────────────────── */
@media (max-width: 1199px) {
    .kh-tdt-grid {
        grid-template-columns: 1fr;
    }
    .kh-tdt-side {
        position: static;
        top: auto;
        order: 2;
    }
}

@media (max-width: 991px) {
    .kh-tdt-h1 { font-size: 1.6rem; }
    .kh-tdt-hero { padding: 26px 0 70px; }
    .kh-tdt-phone.is-tablet {
        width: 100%;
        max-width: 600px;
    }
    .kh-tdt-spec { grid-template-columns: 1fr; }
    .kh-tdt-stage { padding: 28px 12px; min-height: 540px; }
}

@media (max-width: 768px) {
    .kh-tdt-h1 { font-size: 1.35rem; }
    .kh-tdt-sub { font-size: 0.9rem; }
    .kh-tdt-tab { padding: 7px 12px; font-size: 0.78rem; }
    .kh-tdt-tab span { display: none; }
    .kh-tdt-phone {
        width: 100%;
        max-width: 320px;
    }
    .kh-tdt-laptop-screen { height: 480px; }
    .kh-tdt-block { padding: 22px 18px; }
    .kh-tdt-prev-bar { padding: 12px 14px; }
    .kh-tdt-mbar { display: flex; }
    .kh-tdt-body { padding-bottom: 90px; }
}

@media (max-width: 480px) {
    .kh-tdt-phone {
        border-radius: 32px;
        padding: 10px;
    }
    .kh-tdt-phone-screen {
        height: 520px;
        border-radius: 22px;
    }
    .kh-tdt-sim { min-width: 200px; max-width: 200px; }
    .kh-tdt-stage { padding: 18px 8px; min-height: 520px; }
    .kh-tdt-card { padding: 18px; }
    .kh-tdt-quick { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════════════════
   BUILT CARDS — live examples of pages built with this template
   ═════════════════════════════════════════════════════════════════ */
.kh-tdt-built-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.kh-tdt-built-head .t {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--kh-deep);
    display: flex;
    align-items: center;
    gap: 8px;
}
.kh-tdt-built-head .t i { color: var(--kh-acc); }
.kh-tdt-built-head .sub {
    font-size: .82rem;
    color: var(--kh-mute);
    line-height: 1.7;
}
.kh-tdt-built-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--kh-acc-soft);
    color: var(--kh-acc-2);
    font-size: .76rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
}
.kh-tdt-built-pill i { font-size: .85rem; }

.kh-tdt-built-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.kh-tdt-built {
    background: #fff;
    border: 1px solid var(--kh-line);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
}
.kh-tdt-built:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(106, 73, 242, .10);
    border-color: rgba(106, 73, 242, .35);
}

.kh-tdt-built-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 55%),
        linear-gradient(135deg, var(--kh-acc) 0%, var(--kh-acc-2) 100%);
    color: #fff;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.kh-tdt-built-cover::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    bottom: -90px;
    left: -50px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
    pointer-events: none;
}
.kh-tdt-built-favicon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    font-size: 1.2rem;
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(6px);
    z-index: 1;
}
.kh-tdt-built-favicon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kh-tdt-built-cover-foot {
    position: relative;
    z-index: 1;
}
.kh-tdt-built-cover-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kh-tdt-built-cover-sub {
    font-size: .78rem;
    opacity: .85;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kh-tdt-built-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.kh-tdt-built-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.kh-tdt-built-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--kh-bg-2);
    color: var(--kh-acc-2);
    font-size: .72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}
.kh-tdt-built-chip i { font-size: .82rem; opacity: .8; }
.kh-tdt-built-url {
    direction: ltr;
    font-size: .78rem;
    color: var(--kh-mute);
    background: #fafafe;
    border: 1px dashed #e2dff2;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kh-tdt-built-url i { color: var(--kh-acc); flex-shrink: 0; }

.kh-tdt-built-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 4px;
}
.kh-tdt-built-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .76rem;
    color: var(--kh-mute);
    font-weight: 600;
}
.kh-tdt-built-views i { color: var(--kh-acc); }
.kh-tdt-built-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--kh-acc-soft);
    color: var(--kh-acc-2);
    font-size: .78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    transition: background .2s, color .2s;
}
.kh-tdt-built:hover .kh-tdt-built-cta {
    background: var(--kh-acc);
    color: #fff;
}

/* Empty state */
.kh-tdt-built-empty {
    text-align: center;
    padding: 40px 16px;
    background: #fff;
    border: 1px dashed var(--kh-line);
    border-radius: 16px;
    color: var(--kh-mute);
}
.kh-tdt-built-empty i {
    font-size: 2.6rem;
    color: var(--kh-acc);
    display: block;
    margin-bottom: 10px;
    opacity: .75;
}
.kh-tdt-built-empty p { margin: 0; font-size: .9rem; line-height: 1.9; }
.kh-tdt-built-empty strong { color: var(--kh-acc-2); }

@media (max-width: 575px) {
    .kh-tdt-built-grid { grid-template-columns: 1fr; }
}
